home *** CD-ROM | disk | FTP | other *** search
- 'Script to create CoordText Turbo Shape and add it to a TurboCAD drawing
- Global Const gkGRAPHIC = &H0B
- Global Const cartesian = 2
- sub Main()
- Dim g As Long
- Dim r As Long
- Dim v As Long
-
- Dim e As String
-
- 'Create a graphic with kind = gkGraphic and Regen Method
- 'CoordText.TCWCoordText. TCWGraphicCreate will cause OnNewGraphic
- 'to be called
- g = TCWGraphicCreate(gkGraphic, "CoordText.TCWCoordText")
-
- 'if we got an error, display error message and stop
- if (TCWLastErrorGet(e) <> 0) Then
- msgbox e
- stop
- end if
-
- 'Need up update properties to get RegenGraphic to be called
- e = TCWGraphicPropertySet(g, "CoordType", cartesian)
-
- if (TCWLastErrorGet(e) <> 0) Then
- msgbox e
- end if
-
- 'Let's change the color of our CoordText shape as well
- e = TCWGraphicPropertySet(g, "PenColor", &H000000FF)
-
- if (TCWLastErrorGet(e) <> 0) Then
- msgbox e
- end if
-
- 'Add the graphic to the drawing
- TCWGraphicAppend 0, g
-
- if (TCWLastErrorGet(e) <> 0) Then
- msgbox e
- end if
-
- 'Force the graphic to be drawn on the drawing
- TCWGraphicDraw g, 0
- if (TCWLastErrorGet(e) <> 0) Then
- msgbox e
- end if
- end Sub
-
-